//
//  YMMainPlayerView.h
//  SmartCar
//
//  Created by y s on 2022/12/20.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@class YMPlayerSlider,YMMainPlayerView;

@protocol YMPlayerViewDelegate <NSObject>

@optional
- (void)clickPlayerFullScreen:(YMMainPlayerView *)playerView;
- (void)toolBarChangeHidden;
- (void)playFinished;

//开始播放
- (void)playStart;
//播放停止
- (void)playStop;
//播放暂停
- (void)playPause;

@end

@interface YMMainPlayerView : UIView

@property (nonatomic, weak) id<YMPlayerViewDelegate>delegate;

//视频地址
@property (nonatomic,copy) NSString *urlString;
//是否播放完毕
@property (nonatomic,assign) BOOL playEnded;
//是否是全屏
@property (nonatomic,assign) BOOL fullScreen;
@property (nonatomic,assign) BOOL notCanTouch;
@property (nonatomic,assign) BOOL autoHideToolbar;

@property (nonatomic,strong) UILabel *topTitle;
@property (nonatomic,strong) UIView *toolView;
@property (nonatomic,strong) UIButton *playButton;
/** 倍速背景view */
@property (nonatomic, strong) UIView *vRateBg;


- (void)showToolBar;
- (void)playWithUrlString:(NSString *)urlString;
- (void)play;
- (void)pause;
- (void)stop;

- (BOOL)isPlaying;

/** 重置 */
- (void)resetAll:(BOOL)isFullBack;

@end

NS_ASSUME_NONNULL_END
